{% include "../public/min-header.html" %}
<style type="text/css">
	.table td{text-align: center;}
    body{overflow-y: hidden;}
</style>
<div class="wrapper">
    {% include "../public/breadcrumb.html" %}
    <!-- Main content -->
    <section class="content">
        <div class="container-fluid">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 会员列表</h3>
                </div>
                <div class="panel-body">
                    <div class="navbar navbar-default">
                        <form action="" id="search-form2" class="navbar-form form-inline" method="get" onsubmit="return true">
                            <div class="form-group">
                                <label class="control-label" style="margin-right: 20px;">会员查找条件</label>
                            		<select name="sousuo" class="form-control">
                        				<option value="name" {{'selected' if sousuo== 'name' else ''}}>用户名</option>
                        				<option value="userid" {{'selected' if sousuo== 'userid' else ''}}>用户ID</option>
                                        <option value="mobile" {{'selected' if sousuo== 'mobile' else ''}}>电话</option>
                            		</select>
                                <input type="text" name="content" value="{{keyword}}" class="form-control" placeholder="搜索词">
                        		<input type="hidden" name="order_by" value="{{order_by}}">
                                <input type="hidden" name="sort" value="{{sort}}">
                                <input type="hidden" name="act" value="" class="act">
                                <button type="button" class="btn btn-primary pull-right download" style="margin: 0 20px;"><i class="fa fa-download"></i> 导出</button>
                        		<button type="submit" id="button-filter search-order" class="btn btn-primary pull-right search" style="margin-left: 20px;"><i class="fa fa-search"></i> 查找</button>
                            </div>
                            <a href="{{helper.pathFor('adurad')}}" class="btn btn-primary">新增</a>
                        </form>
                    </div>

                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>
                                    <a href="javascript:sort('userid');">用户ID</a>
                                </th>
                                <th>
                                    <a href="javascript:;">用户名</a>
                                </th>
                                <th>
                                    <a href="javascript:;">手机号码</a>
                                </th>
                                <th>
                                    <a href="javascript:;">积分</a>
                                </th>
                                <th>
                                    <a href="javascript:;">QQ</a>
                                </th>
                                <th>
                                    <a href="javascript:;">邮箱</a>
                                </th>
                                <th>
                                    <a href="javascript:sort('create_time');">注册日期</a>
                                </th>
                                <th>
                                    <a href="javascript:;">状态</a>
                                </th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for vo in lists%}
                                <tr>
                                    <td>{{vo.id}}</td>
                                    <td>{{vo.username}}</td>
                                    <td>{{vo.mobile}}</td>
                                    <td>{{vo.credit}}</td>
                                    <td>{{vo.qq}}</td>
                                    <td>{{vo.email}}</td>
                                    <td>{{helper.time_to_date(vo.create_time,5)}}</td>
                                    <td>{{'正常' if vo.status else '冻结'}}</td>
                                    <td>
                                        <a href="{{helper.pathFor('adurdt',{id:vo.id})}}" data-toggle="tooltip" title="查看详情" class="btn btn-info" data-original-title="查看详情"><i class="glyphicon glyphicon-pencil"></i></a>
                                        <a href="javascript:;" data-toggle="tooltip" title="删除" class="btn btn-danger setRemove" data-original-title="删除" data-post-url="{{helper.pathFor('adcoset')}}" data-id="{{vo.id}}" data-jump-url="{{helper.pathFor('adurin')}}" data-type="user"><i class="fa fa-trash-o"></i></a>
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                    {% include "../public/page.html" %}
                </div>
            </div>
        </div>        <!-- /.row -->
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<script>
    // 点击排序
    function sort(field)
    {
        $("input[name='order_by']").val(field);
        var v = $("input[name='sort']").val() == 'desc' ? 'asc' : 'desc';
        $("input[name='sort']").val(v);
        $('#search-form2').submit();
    }

    $(function () {
        $('.search').on('click',function () {
            $('.act').val('');
            $('#search-form2').submit();
        });
        $('.download').on('click',function () {
            $('.act').val('down');
            $('#search-form2').submit();
        });
    });
</script>
{% include "../public/main-footer.html" %}